package cn.com.surker.oa.dao;

import cn.com.surker.oa.entity.OaMaterial;
import cn.com.surker.oa.vo.OaMaterialVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 材料表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2022-10-05
 */
public interface OaMaterialDao extends BaseMapper<OaMaterial> {


    OaMaterial findFullName(String fullName);

    /**
     * 分页查询材料信息
     * @param page
     * @param searchVal
     * @param type
     * @return
     */
    IPage<OaMaterialVo> findPage(Page<OaMaterialVo> page, String searchVal,
                                 Integer type, Integer status, Long orgId);

    /**
     * 根据公司ID或供应商ID查询材料信息
     * @param orgId
     * @return
     */
    List<OaMaterial> findByOrg(Long orgId, Long supplierId);

    /**
     * 根据类型查询材料信息
     * @param orgId
     * @param type
     * @param startTime
     * @param endTime
     * @return
     */
    List<OaMaterial> findByType(Long orgId, Integer type, String startTime, String endTime);

}
